package cn.brilliantfuture.commentry.entity;

// Generated 2012-8-23 15:39:48 by Hibernate Tools 3.3.0.GA

import static javax.persistence.GenerationType.IDENTITY;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.UniqueConstraint;

import org.hibernate.validator.Length;
import org.hibernate.validator.NotNull;

/**
 * StorageServiceInfo generated by hbm2java
 */
@Entity
@Table(name = "storage_service_info", catalog = "cabinet", uniqueConstraints = @UniqueConstraint(columnNames = "storage_rfid"))
public class StorageServiceInfo implements java.io.Serializable {

	private static final long serialVersionUID = 1L;
	private Integer storageServiceInfoId;
	private StorageChargeInfo storageChargeInfo;
	//订单号
	private String number;
	private String storageRfid;
	private String storagePasswd;
	private Purchaser purchaser;
	private Lockers lockers;
	private Integer groupId;
	private Integer orderInformationId;
	//是否可用
	private boolean enable = true;
	private Date deliveryTime;
	private Date takeoutTime;
	private Float chargeTime;
	private Double chargeAmount;
	private Date insertTime;

	public StorageServiceInfo() {
	}

	public StorageServiceInfo(String number, String storageRfid,
			String storagePasswd, Purchaser purchaser, boolean enable,
			Date insertTime) {
		this.number = number;
		this.storageRfid = storageRfid;
		this.storagePasswd = storagePasswd;
		this.purchaser = purchaser;
		this.enable = enable;
		this.insertTime = insertTime;
	}

	public StorageServiceInfo(StorageChargeInfo storageChargeInfo,
			String number, String storageRfid, String storagePasswd,
			Purchaser purchaser, Integer orderInformationId, boolean enable,
			Date deliveryTime, Date takeoutTime, Float chargeTime,
			Double chargeAmount, Date insertTime) {
		this.storageChargeInfo = storageChargeInfo;
		this.number = number;
		this.storageRfid = storageRfid;
		this.storagePasswd = storagePasswd;
		this.purchaser = purchaser;
		this.orderInformationId = orderInformationId;
		this.enable = enable;
		this.deliveryTime = deliveryTime;
		this.takeoutTime = takeoutTime;
		this.chargeTime = chargeTime;
		this.chargeAmount = chargeAmount;
		this.insertTime = insertTime;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "storage_service_info_id", unique = true, nullable = false)
	public Integer getStorageServiceInfoId() {
		return this.storageServiceInfoId;
	}

	public void setStorageServiceInfoId(Integer storageServiceInfoId) {
		this.storageServiceInfoId = storageServiceInfoId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "storage_charge_info_id")
	public StorageChargeInfo getStorageChargeInfo() {
		return this.storageChargeInfo;
	}

	public void setStorageChargeInfo(StorageChargeInfo storageChargeInfo) {
		this.storageChargeInfo = storageChargeInfo;
	}

	@Column(name = "number", nullable = false, length = 50)
	@NotNull
	@Length(max = 50)
	public String getNumber() {
		return this.number;
	}

	public void setNumber(String number) {
		this.number = number;
	}

	@Column(name = "storage_rfid", unique = true, nullable = false, length = 50)
	@NotNull
	@Length(max = 50)
	public String getStorageRfid() {
		return this.storageRfid;
	}

	public void setStorageRfid(String storageRfid) {
		this.storageRfid = storageRfid;
	}

	@Column(name = "storage_passwd", nullable = false, length = 50)
	@NotNull
	@Length(max = 50)
	public String getStoragePasswd() {
		return this.storagePasswd;
	}

	public void setStoragePasswd(String storagePasswd) {
		this.storagePasswd = storagePasswd;
	}

	@Column(name = "order_information_id")
	public Integer getOrderInformationId() {
		return this.orderInformationId;
	}

	public void setOrderInformationId(Integer orderInformationId) {
		this.orderInformationId = orderInformationId;
	}

	@Column(name = "enable", nullable = false)
	public boolean isEnable() {
		return this.enable;
	}

	public void setEnable(boolean enable) {
		this.enable = enable;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "delivery_time", length = 19)
	public Date getDeliveryTime() {
		return this.deliveryTime;
	}

	public void setDeliveryTime(Date deliveryTime) {
		this.deliveryTime = deliveryTime;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "takeout_time", length = 19)
	public Date getTakeoutTime() {
		return this.takeoutTime;
	}

	public void setTakeoutTime(Date takeoutTime) {
		this.takeoutTime = takeoutTime;
	}

	@Column(name = "charge_time", precision = 12, scale = 2)
	public Float getChargeTime() {
		return this.chargeTime;
	}

	public void setChargeTime(Float chargeTime) {
		this.chargeTime = chargeTime;
	}

	@Column(name = "charge_amount", precision = 22, scale = 2)
	public Double getChargeAmount() {
		return this.chargeAmount;
	}

	public void setChargeAmount(Double chargeAmount) {
		this.chargeAmount = chargeAmount;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "insert_time", nullable = false, length = 19)
	@NotNull
	public Date getInsertTime() {
		return this.insertTime;
	}

	public void setInsertTime(Date insertTime) {
		this.insertTime = insertTime;
	}

	@ManyToOne
	@JoinColumn(name = "purchaser_id")
	public Purchaser getPurchaser() {
		return purchaser;
	}

	public void setPurchaser(Purchaser purchaser) {
		this.purchaser = purchaser;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "lockers_id")
	public Lockers getLockers() {
		return lockers;
	}

	public void setLockers(Lockers lockers) {
		this.lockers = lockers;
	}

	@Column(name = "group_id", nullable = false)
	public Integer getGroupId() {
		return groupId;
	}

	public void setGroupId(Integer groupId) {
		this.groupId = groupId;
	}

}
